package com.atuguigu.boot3.core.service;

import com.atuguigu.boot3.core.entity.User;
import com.atuguigu.boot3.core.event.LoginSuccessEvent;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;

@Service
public class SysService {
    @EventListener
    public void onEvent(LoginSuccessEvent event){
        System.out.println("系统接口收到监听信息");
        User source = (User)event.getSource();
//        recordLog(source.getUsername());
    }
   public void recordLog(String username){
       System.out.println(username +"记录了日志");
   }
}
